package com.cysd.ewmksbs.ui.fragment

import android.content.Intent
import android.os.Bundle
import com.cszy.ewmxns.base.BaseVMFragment
import com.cszy.ewmxns.common.AppConstants

import com.cysd.ewmksbs.ui.activity.Ksb_FeedBackActivity
import com.cysd.ewmksbs.ui.activity.Ksb_HtmlActivity
import com.cysd.ewmksbs.ksb_utils.AppUtil
import com.cysd.ewmksbs.viewmodel.MainViewModel
import com.hlyj.http.ad.NewGroMoreFeedAdManager
import com.hnyyac.ad.mds.utils.BaseAdConstants
import com.csylhl.ewmksb.databinding.FragmentWodeBinding


class Ksb_WodeFragment : BaseVMFragment<MainViewModel, FragmentWodeBinding>() {
    private var newGromoreFeedAd : NewGroMoreFeedAdManager? =null
    override fun initView(savedInstanceState: Bundle?) {
        val app_version = AppUtil.getVersionName()
        mBinding.apply {
            appVersion.text = "App版本：${app_version}${" " +AppUtil.getChannel()}"
        }
    }

    override fun initData() {
        //启动流程
        newGromoreFeedAd = NewGroMoreFeedAdManager(requireActivity(), BaseAdConstants.FEEDAD_Id, mBinding?.fragmentContainer,62)
        newGromoreFeedAd?.loadAd()
    }

    override fun initListener() {
        mBinding.rvXieyi.setOnClickListener {
            val intent = Intent(
                requireContext(),
                Ksb_HtmlActivity::class.java
            )
            intent.putExtra("url", AppConstants.User_Agreement)
            intent.putExtra("title", "用户协议")
            startActivity(intent)
        }

        mBinding.rvYinsi.setOnClickListener {
            val intent = Intent(
                requireContext(),
                Ksb_HtmlActivity::class.java
            )
            intent.putExtra("url", AppConstants.Privacy_Policy)
            intent.putExtra("title", "隐私政策")
            startActivity(intent)
        }

        mBinding.rvFeedback.setOnClickListener {
            startActivity(Intent(requireContext(), Ksb_FeedBackActivity::class.java))
        }

    }
}